<template>
  <div>
    <button @click="isshow=!isshow">显示/隐藏</button>
    <transition-group name="hello" appear>
    <h1 v-show="!isshow" key="1">你好！</h1>
    <h1 v-show="isshow" key="2">召唤师！</h1>
    </transition-group>
  </div>
</template>

<script>
export default {
  name: "Test2",
  data(){
    return{
        isshow:true
    }
  }
}
</script>

<style scoped>
  h1{
    background-color: orange;
   /*transition:  0.5s linear;*/
  }
  /*进入起点，推出的终点*/
  .hello-enter,.hello-leave-to{
    transform: translateX(-100%);
  }
  .hello-enter-active,.hello-leave-active{
    transition:  0.5s linear;
  }
  /*进入终点，推出的起点*/
  .hello-enter-to,.hello-leave{
    transform: translateX(0);
  }


</style>